package pa14.proj.boundschecker.test;

/* @Author : Shivam Chaturvedi
 * 
 */

public class TC2_BranchBounds {

	public static void main(String[] args) {
		TC2_BranchBounds test = new TC2_BranchBounds();
		test.branchIndexing();
		test.branchArrayCreation();
	}
	
	public void branchIndexing(){
		int[] arr = new int[5];
		int x = 0;
		int a=2 , b=3;
		if(a > b){
			x = 3;
		}else{
			x = 5;
		}
		
		b = arr[x];
	}
	
	public void branchArrayCreation(){
		/* this function's exception does not get detected by the analysis */
		int[] arr;
		int a=2, b=3;
		if(a > b){
			arr = new int[3];
		}else{
			arr = new int[5];
		}
		
		b = arr[4];
	}
}
